# -*- coding: utf-8 -*-
# __author__ :Li
# 2022/5/6 9:40
#聚水潭订单API


#订单查询
def orders_query(self,shop_id=None,is_offline_shop=None,so_ids=None,modified_begin='',modified_end='',status='',page_index=None,page_size=50):
    '''
    :param self:
    :param shop_id:店铺编号
    :param is_offline_shop:shop_id为0且is_offline_shop为true查询线下店铺单据
    :param so_ids:线上单号，最大限制20条
    :param modified_begin:修改起始时间，和结束时间必须同时存在，时间间隔不能超过七天，与线上单号不能同时为空
    :param modified_end:修改结束时间，和起始时间必须同时存在，时间间隔不能超过七天，与线上单号不能同时为空
    :param status:待付款：WaitPay；发货中：Delivering；被合并：Merged；异常：Question；被拆分：Split；等供销商|外仓发货：WaitOuterSent；已付款待审核：WaitConfirm；已客审待财审：WaitFConfirm；已发货：Sent；取消：Cancelled
    :param page_index:第几页，从1 开始
    :param page_size:最每页多少条，最大50条
    :return:
    '''
    params = {}
    path = '/open/orders/single/query'
    if shop_id is not None:
        params['shop_id'] = shop_id
    if is_offline_shop is not None:
        params['is_offline_shop'] = is_offline_shop
    if so_ids is not None:
        params['so_ids'] = so_ids
    if modified_begin:
        params['modified_begin'] = modified_begin
    if modified_end:
        params['modified_end'] = modified_end
    if status:
        params['status'] = status
    if page_index:
        params['page_index'] = page_index
    params['page_size'] = page_size

    return self.request(path=path,data=params)

def orderbyoid_cancel(self,o_ids:list,cancel_type:str,remark=''):
    pass